class Person {

    *getArray() {
        yield 1;
        yield 2;
        yield 3;
    }
    static sayHi() {
        console.log('Hi');
    }

}

let p = new Person();

console.log(p);

console.log([...p.getArray()]); // Generator 函数生成的 Generator 对象即是可迭代对象又是迭代器对象；

Person.sayHi();
console.log(Person.prototype);
console.log(Person.prototype.constructor === Person);